/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.awt.Point;
/*     */ import java.util.Locale;
/*     */ import net.minecraft.client.Minecraft;
/*     */ import net.minecraft.client.gui.FontRenderer;
/*     */ import net.minecraft.client.renderer.GlStateManager;
/*     */ import net.minecraft.client.renderer.RenderHelper;
/*     */ import net.minecraft.client.renderer.RenderItem;
/*     */ import net.minecraft.client.renderer.block.model.IBakedModel;
/*     */ import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
/*     */ import net.minecraft.client.renderer.texture.TextureManager;
/*     */ import net.minecraft.client.renderer.texture.TextureMap;
/*     */ import net.minecraft.item.ItemStack;
/*     */ import net.minecraft.world.World;
/*     */ import net.minecraftforge.client.ForgeHooksClient;
/*     */ import org.lwjgl.opengl.GL11;
/*     */ import org.yaml.snakeyamla.configuration.ConfigurationSection;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class fk
/*     */   extends pi
/*     */ {
/*     */   public bh w;
/*     */   public bh q;
/*     */   public bh g;
/*     */   
/*     */   public fk(vh vh1, ConfigurationSection configurationSection) {
/*  39 */     super(vh1, configurationSection);
/*  40 */     this.w = createMoLangParserString("identifier", "unknown");
/*     */     
/*  42 */     this.p = createMoLangParser("width", Integer.valueOf(16));
/*  43 */     this.n = createMoLangParser("height", Integer.valueOf(16));
/*  44 */     this.g = createMoLangParserString("amount", "");
/*  45 */     this.q = createMoLangParser("drawBackground", Boolean.valueOf(true));
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public void preRender(int i, int j) {
/*  51 */     jo.v((float)this.ua.v());
/*  52 */     if (this.g.containsKey(Integer.valueOf(0))) {
/*  53 */       this.c = (i - ((Point)this.g.get(Integer.valueOf(0))).x);
/*  54 */       this.r = (j - ((Point)this.g.get(Integer.valueOf(0))).y);
/*     */     } 
/*  56 */     this.c = sk.v(this.c, this.j.v(), this.h.v());
/*  57 */     this.r = sk.v(this.r, this.u.v(), this.y.v());
/*     */     
/*  59 */     GlStateManager.func_179094_E();
/*     */ 
/*     */     
/*  62 */     double d1 = this.k.v();
/*  63 */     double d2 = this.o.v();
/*     */     
/*  65 */     this.w = (d1 != 0.0D && d2 != 0.0D) ? 1 : 0;
/*  66 */     if (this.w != null) {
/*  67 */       GL11.glEnable(3089);
/*  68 */       jo.v((int)getLimitXPos(), (int)getLimitYPos(), (int)d1, (int)d2);
/*     */     } 
/*     */ 
/*     */     
/*  72 */     GlStateManager.func_179137_b(
/*  73 */         Math.floor((getXPos() + this.t.v() + this.c) * 10.0D) / 10.0D, 
/*  74 */         Math.floor((getYPos() + this.d.v() + this.r) * 10.0D) / 10.0D, 0.0D);
/*     */ 
/*     */ 
/*     */ 
/*     */     
/*  79 */     double d3 = this.ia.v();
/*  80 */     GlStateManager.func_179139_a(d3, d3, 1.0D);
/*     */ 
/*     */     
/*  83 */     d3 = this.p.v();
/*  84 */     double d4 = this.n.v();
/*     */     
/*  86 */     GlStateManager.func_179137_b(d3 / 2.0D, d4 / 2.0D, 0.0D);
/*  87 */     double d5 = this.f.v();
/*     */     
/*  89 */     GlStateManager.func_179139_a(d5, d5, 1.0D);
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     
/*  97 */     GlStateManager.func_179137_b(-d3 / 2.0D, -d4 / 2.0D, 0.0D);
/*     */   }
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*     */   public void render(int i, int j) {
/* 107 */     fj<ItemStack, String> fj = dh.d.v(this.w.v(), this.ta.isHud());
/* 108 */     ItemStack itemStack = fj.z();
/* 109 */     if (itemStack == null)
/*     */       return; 
/* 111 */     boolean bool = this.q.v();
/* 112 */     if (fj.v() != null && ((String)fj.v()).endsWith("§c") && bool) {
/* 113 */       jo.v(0.0D, 0.0D, this.p.v(), this.n.v(), -2130706433);
/*     */     }
/*     */     
/* 116 */     if (!itemStack.func_190926_b() && jo.v() >= 1.0F) {
/* 117 */       RenderItem renderItem = Minecraft.func_71410_x().func_175599_af();
/* 118 */       FontRenderer fontRenderer1 = itemStack.func_77973_b().getFontRenderer(itemStack);
/* 119 */       FontRenderer fontRenderer2 = (Minecraft.func_71410_x()).field_71466_p;
/*     */       
/* 121 */       GlStateManager.func_179094_E();
/* 122 */       GlStateManager.func_179139_a(this.p.v() / 16.0D, this.n.v() / 16.0D, 1.0D);
/* 123 */       RenderHelper.func_74520_c();
/* 124 */       GlStateManager.func_179126_j();
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */       
/* 137 */       wr.g = true;
/* 138 */       IBakedModel iBakedModel = renderItem.func_184393_a(itemStack, (World)(Minecraft.func_71410_x()).field_71441_e, null);
/* 139 */       renderItemModelIntoGUI(itemStack, 0, 0, iBakedModel);
/* 140 */       wr.g = false;
/* 141 */       String str = this.g.v();
/* 142 */       if (!str.isEmpty()) {
/* 143 */         renderItem.func_180453_a((fontRenderer1 == null) ? fontRenderer2 : fontRenderer1, itemStack, 0, 0, str);
/*     */       } else {
/* 145 */         renderItem.func_180453_a((fontRenderer1 == null) ? fontRenderer2 : fontRenderer1, itemStack, 0, 0, fj.v());
/*     */       } 
/*     */ 
/*     */       
/* 149 */       GlStateManager.func_179121_F();
/* 150 */       RenderHelper.func_74518_a();
/*     */     } 
/*     */     
/* 153 */     if (this.ta.a == this && bool) {
/* 154 */       GlStateManager.func_179140_f();
/* 155 */       GlStateManager.func_179097_i();
/* 156 */       jo.v(0.0D, 0.0D, this.p.v(), this.n.v(), -2130706433);
/* 157 */       GlStateManager.func_179126_j();
/*     */     } 
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public void runClick(int i, int j, int k) {
/* 164 */     super.runClick(i, j, k);
/*     */     
/* 166 */     if (!kk.z(this.ta, "slotClick", new o[] { ah.v(this.xa.getName()), xk.v(Integer.valueOf(k)) }).v()) {
/* 167 */       uy.v("DragonCore_ClickSlot", new String[] { this.w
/*     */             
/* 169 */             .v(), 
/* 170 */             String.valueOf(k) });
/*     */     }
/*     */   }
/*     */ 
/*     */ 
/*     */   
/*     */   public void cache(int i, int j) {
/* 177 */     super.cache(i, j);
/* 178 */     this.w.z();
/* 179 */     this.q.z();
/*     */     
/* 181 */     this.g.z();
/*     */   }
/*     */ 
/*     */   
/*     */   public void setValue(String str, Object object) {
/* 186 */     switch (str.toLowerCase(Locale.ROOT)) {
/*     */       case "identifier":
/* 188 */         this.w = toMolangParser((String)object);
/*     */         return;
/*     */       case "drawbackground":
/* 191 */         this.q = toMolangParser(object);
/*     */         break;
/*     */       case "amount":
/* 194 */         this.g = toMolangParser((String)object);
/*     */         break;
/*     */     } 
/* 197 */     super.setValue(str, object);
/*     */   }
/*     */ 
/*     */   
/*     */   public Object getValue(String str) {
/* 202 */     switch (str.toLowerCase(Locale.ROOT)) {
/*     */       case "type_":
/*     */       case "type":
/* 205 */         return "slot";
/*     */       case "identifier":
/* 207 */         return this.w.z();
/*     */       case "drawbackground":
/* 209 */         return this.q.z();
/*     */       
/*     */       case "identifier_":
/* 212 */         return this.w.h();
/*     */       case "drawbackground_":
/* 214 */         return this.q.h();
/*     */       case "amount":
/* 216 */         return this.g.z();
/*     */       case "amount_":
/* 218 */         return this.g.h();
/*     */     } 
/*     */     
/* 221 */     return super.getValue(str);
/*     */   }
/*     */ 
/*     */   
/*     */   public void renderItemModelIntoGUI(ItemStack itemStack, int i, int j, IBakedModel iBakedModel) {
/* 226 */     uaa.q.v(itemStack, 0.0D, 0.0D, 0);
/* 227 */     TextureManager textureManager = Minecraft.func_71410_x().func_110434_K();
/* 228 */     RenderItem renderItem = Minecraft.func_71410_x().func_175599_af();
/*     */     
/* 230 */     GlStateManager.func_179094_E();
/* 231 */     textureManager.func_110577_a(TextureMap.field_110575_b);
/* 232 */     textureManager.func_110581_b(TextureMap.field_110575_b).func_174936_b(false, false);
/* 233 */     GlStateManager.func_179091_B();
/* 234 */     GlStateManager.func_179141_d();
/* 235 */     GlStateManager.func_179092_a(516, 0.1F);
/* 236 */     GlStateManager.func_179147_l();
/* 237 */     GlStateManager.func_187401_a(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
/* 238 */     GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F);
/* 239 */     v(iBakedModel.func_177556_c());
/*     */ 
/*     */ 
/*     */     
/* 243 */     GlStateManager.func_179114_b((float)this.s.v(), 1.0F, 0.0F, 0.0F);
/* 244 */     GlStateManager.func_179114_b((float)this.m.v(), 0.0F, 1.0F, 0.0F);
/* 245 */     GlStateManager.func_179114_b((float)this.l.v(), 0.0F, 0.0F, 1.0F);
/*     */     
/* 247 */     iBakedModel = ForgeHooksClient.handleCameraTransforms(iBakedModel, ItemCameraTransforms.TransformType.GUI, false);
/* 248 */     renderItem.func_180454_a(itemStack, iBakedModel);
/*     */     
/* 250 */     GlStateManager.func_179118_c();
/* 251 */     GlStateManager.func_179101_C();
/* 252 */     GlStateManager.func_179140_f();
/* 253 */     GlStateManager.func_179121_F();
/* 254 */     textureManager.func_110577_a(TextureMap.field_110575_b);
/* 255 */     textureManager.func_110581_b(TextureMap.field_110575_b).func_174935_a();
/* 256 */     uaa.q.v(itemStack, 0.0D, 0.0D, 1);
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\fk.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */